<template>
    <div>
    </div>
</template>
<script lang="ts">
import {defineComponent, getCurrentInstance} from 'vue';
export default defineComponent({
    name:'axios',
    setup(){
        //获取当前实例,as any 可以为任意值强制标记存在
        const { proxy } =getCurrentInstance() as any;
        //
        proxy.$http.get('https://www.fastmock.site/mock/92c6a880ec2c67f316232e5bf444517b/api/api/auth')
        .then(res=>{
            console.log(res.data.data);
            
        }).catch(err=>{
            console.log(err);
            
        })

    }
})
</script>
<style scoped>
</style>